﻿namespace Sidvall.IO
{
    public class AzureSystemContext
    {
        #region Public Members

        public string StorageConnectionString { get; set; }
        public int DefaultBufferSize { get; set; }

        #endregion
        #region Factory Members

        #region Current

        private static readonly object _Mutex = new object();
        private static volatile AzureSystemContext _Current;
        public static AzureSystemContext Current
        {
            get
            {
                AzureSystemContext item;

                if (_Current == null)
                {
                    lock (_Mutex)
                    {
                        if (_Current == null)
                        {
                            item = new AzureSystemContext()
                            {
                                DefaultBufferSize = 250000,
                            };
                            _Current = item;
                        }
                    }
                }
                return _Current;
            }
            set
            {
                lock (_Mutex)
                {
                    _Current = value;
                }
            }
        }

        #endregion

        #endregion
    }
}
